package com.mifengs.mall.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mifengs.mall.R;
import com.mifengs.mall.entity.AdvertBean;
import com.mifengs.mall.util.ImageLoadUtil;

import java.util.List;

/**
 * Created by lynn on 2017/11/2.
 */

public class GridQuickAdapter extends BaseQuickAdapter<AdvertBean,BaseViewHolder> {

    private Context mContext;

    public GridQuickAdapter(@LayoutRes int layoutResId, @Nullable List<AdvertBean> data,Context mContext) {
        super(layoutResId, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, AdvertBean item) {
        ImageView imageView = helper.getView(R.id.pro_img);
        ImageLoadUtil.displayFitImage(mContext,item.getImg(),imageView);
    }

}
